﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Rise.Cenas
{
    public static class CenaManager
    {
        static CenaMenu cena_menu;
        static CenaJogar cena_jogar;
        static CenaCreditos cena_creditos;
        static CenaOver cena_over;

        public enum Cenas
        {
            MENU, CREDITOS, JOGAR, PAUSA, THE_END, GAME_OVER
        }

        public static List<Cena> listaCenas = new List<Cena>();

        public static Cenas cena_atual;

        public static void Load(ContentManager Content, GameWindow Window)
        {
            cena_menu = new CenaMenu(Content, Window);
            cena_jogar = new CenaJogar(Content, Window);
            cena_creditos = new CenaCreditos(Content, Window);
            cena_over = new CenaOver(Content, Window);
        }

        public static void Update(GameTime gameTime)
        {
            switch (cena_atual)
            {
                case Cenas.MENU:
                    CenaManager.cena_menu.Update(gameTime);
                    break;
                
                case Cenas.JOGAR:
                    CenaManager.cena_jogar.Update(gameTime);
                    break;

                case Cenas.CREDITOS:
                    CenaManager.cena_creditos.Update(gameTime);
                    break;

                case Cenas.GAME_OVER:
                    CenaManager.cena_over.Update(gameTime);
                    break;

            }
        }

        public static void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            switch (cena_atual)
            {
                case Cenas.MENU:
                    CenaManager.cena_menu.Draw(gameTime, spriteBatch);
                    Console.WriteLine(listaCenas);
                    break;

                case Cenas.JOGAR:
                   // CenaManager.cena_jogar.Draw(gameTime, spriteBatch);
                    Console.WriteLine(listaCenas);
                    break;

                case Cenas.CREDITOS:
                    CenaManager.cena_creditos.Draw(gameTime, spriteBatch);
                    Console.WriteLine(listaCenas);
                    break;

                case Cenas.GAME_OVER:
                    CenaManager.cena_over.Draw(gameTime, spriteBatch);
                    Console.WriteLine(listaCenas);
                    break;
            
           }
        }

    }
}
